import { Random } from 'mockjs';
import { stringify } from 'postcss';

const notdatapost = [
	'users/addnormaluser',
	'users/deleteaccount',
	'users/modifypassword',
	'users/resetaccountpwd',
	'users/banaccount',
	'material/uploadimgs',
	'material/deleteimg',
	'api/managecards',
	'api/managegroup',
	'api/cardandgrouprelation',
];

const data = [
	...notdatapost.map((url) => ({
		url,
		methods: 'post',
		data: {
			code: 200,
			data: {},
		},
	})),
	{
		url: 'api/getgroupinfo',
		methods: 'post',
		data: {
			code: 200,
			data: {
				id: '@id',
				name: '@ctitle',
				'brandIds|5-20': ['@id'],
			},
		},
	},
	{
		url: 'api/getcardsdetail',
		methods: 'post',
		data: {
			code: 200,
			data: {
				id: '@id',
				name: '@ctitle',
				deck: [1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
				partition: [0, 5, 12],
				linner: {
					'1,2,3': [14, 15, 16, 17],
					2: [22, 23, 24],
					7: [1, 2, 3, 4, 5],
					'1,1,1,1,1,1,1,1,1': [1],
					'2,2,2,2,2,2': [2, 3, 4],
				},
				// "deck|10-30": ["@natural(0,30)"],
				// "partition|1-4": ["@natural(1,15)"],
				// linner: {
				// 	1: [1, 2, 3],
				// 	"2,3": [4, 5, 6],
				// },
			},
		},
	},
	{
		url: 'users/login',
		methods: 'post',
		data: {
			code: 200,
			data: {
				userOpenId: '@paragraph',
				sessionToken: '@paragraph',
				ip: '@ip',
				nickname: '@cname',
				account: "@string('number',11)",
				endTime: '@datetime("yyyy-MM-dd HH:mm:ss")',
				'level|1': [0, 99, 999],
				// username: "@networkname",
				// scroll: "@string('number',3)",
				// "sign|1": [true, false],
			},
		},
	},
	{
		url: 'material/getimgs',
		methods: 'post',
		data: {
			code: 200,
			data: {
				'materials|15': [
					{
						id: '@id',
						imageName: '@ctitle',
						imageURL: '@image',
						make: '自己', // 肯定都是自己
						createtime: '@datetime("yyyy-MM-dd HH:mm:ss")',
						status: 0,
						// inuse:""
					},
				],
				'total|30-1000': 1,
			},
		},
	},
	{
		url: 'api/getcardslist',
		methods: 'post',
		data: {
			code: 200,
			data: {
				'innerDatas|15': [
					{
						id: '@id',
						name: '@ctitle',
						make: '自己', // 肯定都是自己
						createtime: '@datetime("yyyy-MM-dd HH:mm:ss")',
						'deck|10-30': ['@natural(0,30)'],
					},
				],
				'total|30-1000': 1,
			},
		},
	},
	{
		url: 'api/getgrouplist',
		methods: 'post',
		data: {
			code: 200,
			data: {
				'list|15': [
					{
						id: '@id',
						name: '@ctitle',
						make: '自己', // 肯定都是自己
						createtime: '@datetime("yyyy-MM-dd HH:mm:ss")',
						// inuse:""
					},
				],
				'total|30-1000': 1,
			},
		},
	},
	{
		url: 'users/getpermission',
		methods: 'post',
		data: {
			code: 200,
			data: {
				restriction: {
					cardsNum: 999,
					decknum: 999,
					usernum: 999,
				},
				useNum: {
					'cardsNum|1-100': 1,
					'decknum|1-100': 1,
					'usernum|1-100': 1,
				},
				endTime: '@datetime("yyyy-MM-dd HH:mm:ss")',
			},
		},
	},
	{
		url: 'users/getuserlist',
		methods: 'post',
		data: {
			code: 200,
			data: {
				'users|15': [
					{
						id: '@id',
						name: '@cname',
						account: "@string('number',9)",
						category: 3,
						createtime: '@datetime("yyyy-MM-dd HH:mm:ss")',
						inuse: 1,
					},
				],
				'total|1-1000': 1,
			},
		},
	},
	{
		url: '',
		methods: 'post',
		data: {
			code: 200,
			data: {},
		},
	},
];

export default data;
